package chapter4.read

import cn.hutool.json.JSONUtil
import org.apache.spark.{SparkConf, SparkContext}

object Chapter4_3_2 {

  def main(args: Array[String]): Unit = {
    val conf = new SparkConf().setMaster("local").setAppName("readJson")
    val sc = new SparkContext(conf)


    val inputTextFile = sc.textFile("P:\\Project\\Idea\\bigdata\\spark\\src\\main\\resources\\data\\users.json")

    println(inputTextFile.map(JSONUtil.formatJsonStr).collect().mkString("\n"))
    sc.stop()
  }


}
